/* 地图编辑器样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* 顶部标题栏 */
.editor-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 编辑器控制按钮组 */
.editor-controls {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
}

.editor-controls .btn {
    min-width: 100px;
}

.header-title h1 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
}

.header-controls {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 主内容区域 */
.editor-main {
    display: flex;
    flex: 1;
    gap: 20px;
    min-height: 0;
}



/* 左侧工具栏 */
.editor-sidebar {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 右侧调试栏 */
.debug-sidebar {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

/* 模式选择 */
.mode-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-option {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.mode-option:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.mode-option.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.mode-option h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.mode-option p {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 地图设置 */
.map-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-weight: 500;
    color: #555;
}

.setting-group input, .setting-group select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.setting-group input:focus, .setting-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* 元素选择器 */
.element-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.element-item {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.element-item:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.element-item.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.element-item i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: block;
}

/* 编辑工具 */
.edit-tools {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tool-btn {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tool-btn:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.tool-btn.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.tool-btn i {
    font-size: 1.2rem;
}

/* 右侧画布区域 */
.editor-canvas-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.canvas-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    gap: 15px;
}

.canvas-controls .zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.canvas-controls .coordinate-display {
    flex-shrink: 0;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.zoom-display {
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.coordinates {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.canvas-wrapper {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
}

#mapCanvas {
    display: block;
    background: #ecf0f1;
    cursor: crosshair;
}

/* 底部状态栏 - 现在位于画布控制区域 */
.editor-footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 8px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    margin: 0 15px;
    flex: 1;
    max-width: 400px;
}

.editor-footer .status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.editor-footer .status-info,
.editor-footer .status-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.status-info {
    display: flex;
    gap: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-item i {
    color: #3498db;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .editor-main {
        flex-direction: column;
    }
    
    .editor-sidebar {
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .element-selector {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .editor-container {
        padding: 10px;
        gap: 10px;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .element-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .edit-tools {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 特殊样式类 */
.hidden {
    display: none !important;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 网格线样式 */
.grid-line {
    stroke: #bdc3c7;
    stroke-width: 1;
}

.grid-line.major {
    stroke: #95a5a6;
    stroke-width: 2;
}

/* 元素图标颜色 */
.obstacle-icon { color: #e74c3c; }
.spawn-icon { color: #27ae60; }
.respawn-icon { color: #f39c12; }
.special-icon { color: #9b59b6; }
.boss-icon { color: #c0392b; }

/* 画笔大小设置 */
.brush-size-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brush-size-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.brush-size-option {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.brush-size-option:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.brush-size-option.active {
    border-color: #3498db;
    background: #3498db;
    color: white;
}